package com.abcdefg.springioc.demo6;

import com.abcdefg.springioc.BeanDemo;
import com.abcdefg.springioc.User;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class Demo2 {
    @Qualifier("user1")
//    @Autowired
    @Resource(name="user1")
    private User user;

    public void demo2(){
        System.out.println("demo2");
        System.out.println(user.toString());
    }
}
